package com.airy.juju.util

import android.content.Context
import androidx.appcompat.app.AlertDialog


/**
 * Created by Airy on 2019/3/28
 * Mail: a532710813@gmail.com
 * Github: AiryMiku
 */

class UIUtil {

    companion object {

        fun showSimpleConfirmDialog(
            context: Context,
            title: String,
            meaasge: String,
            confirmCallback: () -> Any,
            cancelCallback: () -> Any
        ) {
            val dialogBuilder = AlertDialog.Builder(context)
            dialogBuilder.setTitle(title)
            dialogBuilder.setMessage(meaasge)
            dialogBuilder.setPositiveButton("确认") { _, _ -> confirmCallback() }
            dialogBuilder.setNegativeButton("取消") { _, _ -> cancelCallback() }
            dialogBuilder.create()
            dialogBuilder.show()
        }
    }
}